
<!DOCTYPE HTML>
<html>
    <head>
        <title>Youniversity</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
        
        <link rel="stylesheet" href="style/style.css"/>
        <script src="js/lib/cordova-1.7.0.js"></script>
        <script src="js/lib/zepto.min.js"></script>
        <script src="js/lib/iscroll.js"></script>


        <script src="js/lib/mobiscroll-2.0.custom.min.js"></script>

        <link rel="stylesheet" href="style/mobiscroll-2.0.custom.min.css"/>

        <script type="text/javascript">

           
            var scrollableframe;
            var lectureschedule;
            function loaded() {
                // scrollableframe = new iScroll('scrollableframe',
                //                       { useTransition:false,
                //                         checkDOMChanges: true,
                //                         hideScrollbar: true,
                //                         fixedScrollbar:true,
                //                         bounceLock: true,
                //                         onBeforeScrollStart: function (e) {
                //                             var target = e.target;
                //                             while (target.nodeType != 1) target = target.parentNode;

                //                             if (target.tagName != 'SELECT' && target.tagName != 'OPTION' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA' && target.tagName != 'BUTTON')
                //                                 e.preventDefault();
                //                         } }
                //                     );

                lectureschedule = $('.lectureschedule').last().clone();

                $('select').scroller({
                    preset: 'select',
                    theme: 'android-ics light',
                    display: 'modal',
                    mode: 'scroller',
                });

                $('.time').scroller({
                    preset: 'time',
                    theme: 'android-ics light',
                    display: 'modal',
                    mode: 'scroller',
                    timeFormat: 'HH:ii',
                    timeWheels: 'HHii'
                });

                $('#plus').click(function(){
                    newlectureschedule = lectureschedule.clone();
                    newlectureschedule.children('select').scroller({
                        preset: 'select',
                        theme: 'android-ics light',
                        display: 'modal',
                        mode: 'scroller'
                    });
                    newlectureschedule.children('.time').scroller({
                        preset: 'time',
                        theme: 'android-ics light',
                        display: 'modal',
                        mode: 'scroller',
                        timeFormat: 'HH:ii',
                        timeWheels: 'HHii'
                    });
                    $('.lectureschedule').last().after(newlectureschedule);

                });

                $('#minus').click(function(){
                    $('.lectureschedule').eq(-2).next('.lectureschedule').remove();
                });

                $('.button')
                    .on('touchstart', function () {
                        $(this).addClass('fake-active');
                    })
                    .on('touchend', function() {
                        $(this).removeClass('fake-active');
                    })
                    .on('touchcancel', function() {
                        $(this).removeClass('fake-active');
                    });

                var allSelects = $('button');
                allSelects.each(function(index, item) {
                                  item.addEventListener('touchstart', function(e) { $(this).addClass("fake-active"); }, false);
                                  item.addEventListener('touchend', function(e) { $(this).removeClass("fake-active"); }, false);
                                  item.addEventListener('touchcancel', function(e) { $(this).removeClass("fake-active"); }, false);
                                });
            }

            //document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
            document.addEventListener('DOMContentLoaded', loaded, false);

        </script>

    </head>
    <body class="page">
        <nav>
            <ul>
                <li><a href="explore.html"><img src="resources/img/explore.png"></a></li>
                <li><a href="plan.html"><img src="resources/img/plan.png"></a></li>
                <li><a href="personal.html"><img src="resources/img/personal.png"></a></li>
                <li><a href="events.html"><img src="resources/img/events.png"></a></li>
                <li><a href="updates.html"><img src="resources/img/updates.png"></a></li>
            </ul>
        </nav>
        <header>Crea Corso</header>

        <!-- <div id="scrollableframe">
            <div class="scroller"> -->
                <form>
                    <div class="frame">
                        <ul class="form">
                            <div class="box">
                                <li>Nome Corso<br><input type="text" /></li>
                                <li>CFU<br><input type="number" /></li>
                                <li>Sillabo<br><textarea class="big"></textarea></li>
                                <li>Testi<br><textarea class="small"></textarea></li>
                            </div>
                            <div class="box">
                                <li class="lectureschedule">Lezione<br>
                                    <!-- <input type="text" placeholder="Giorno" maxlength="3" pattern="Lun|Mar|Mer|Gio|Ven"/> -->
                                    <select>
                                        <option>Lun</option>
                                        <option>Mar</option>
                                        <option>Mer</option>
                                        <option>Gio</option>
                                        <option>Ven</option>
                                    </select>
                                    <!-- <input type="time" placeholder="Ora" maxlength="5" /> -->
                                    :: <input class="time" placeholder="Ora" /> - <input class="time" placeholder="Ora" />
                                    :: <input class="hall" type="text" placeholder="Aula" />
                                </li>
                                <div class="centercontent horizontal">
                                    <a class="button small" id="plus">
                                        <span class="icon plus"></span></a>
                                    <a class="button small" id="minus">
                                        <span class="icon minus"></span></a>
                                </div>
                            </div>
                            <!-- <li><input type="text" placeholder="Nome" /></li>
                            <li><input type="text" placeholder="Cognome" /></li>
                            <li><input type="email" placeholder="Email" /></li>
                            <li><input type="number" placeholder="Matricola" /></li>
                            <li><input type="password" placeholder="Password" /></li>
                            <li><input type="password" placeholder="Ripeti password" /></li>
                            <li><input type="text" placeholder="Corso di Laurea" /></li>
                            <li><input type="text" placeholder="Foto" /></li>
                            <li><input type="tel" placeholder="Telefono" /></li>
                            <li><input type="tel" placeholder="Fax" /></li>
                            <li><input type="url" placeholder="WWW" /></li>
                            <li><input type="text" placeholder="Ruolo" /></li> -->
                        </ul>
                    </div>
                    <div class="centercontent">
                        <button type="submit" class="button">
                            <span class="icon tick"></span>
                            <span class="label">Crea</span>
                        </button>
                    </div>
                </form>


        <!--     </div>
        </div> -->

        
        <script src="js/ynv.js"></script>
    </body>
</html>